package compiler;

public class Yytoken {

	private final int column;
	private final int line;
	private final String type;
	private final String value;
	
	public Yytoken(String type, String value, int line, int column){
		this.type=type;
		this.value=value;
		this.line=line;
		this.column=column;
	}
	
	public int line(){
		return line;
	}
	
	public int column(){
		return column;
	}
	
	public String type(){
		return type;
	}
	
	public String value(){
		return value;
	}
	
	public boolean isIdent(){
		return "Ident".equals(type);
	}
	
	public boolean isString(){
		return "String".equals(type);
	}
	
	public boolean isBegin(){
		return "Begin".equals(type);
	}
	
	public boolean isEnd(){
		return "End".equals(type);
	}
	
	public boolean isOperator(){
		return "Operator".equals(type);
	}
	
	public boolean isLiteral(){
		return "Literal".equals(type);
	}
	
	public boolean isInteger(){
		return "Integer".equals(type);
	}
	
	@Override
	public String toString(){
		return "Token("+type+", "+value+", "+line+", "+column+")";
	}
}
